class Commodity_specification_type {
    /**
     * 新增商品规格类别
     * @param specificationTypeName 商品规格类别
     * @returns {Promise<json>}
     */
    insertCommoditySpecificationType(specificationTypeName){
        return new Promise((resolve, reject) => {
            $.ajax({
                url: "/www.xiaomi.com/background/insert/commodity/type/specification",
                method: "POST",
                data: {
                    specificationTypeName:specificationTypeName,
                },
                success: function (response) {
                    resolve(response);
                },
                error: function (error) {
                    reject(error);
                }
            });
        })
    }
    /**
     * 查询全部商品规格类别
     * @returns {Promise<json>}
     */
    getAllCommoditySpecificationTypes(specificationTypeName){
        return new Promise((resolve, reject) => {
            $.ajax({
                url: "/www.xiaomi.com/background/get/all/commodity/specification",
                method: "GET",
                success: function (response) {
                    resolve(response);
                },
                error: function (error) {
                    reject(error);
                }
            });
        })
    }
}